package day0531;

import java.util.Scanner;

public class File10 {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        double   sal=s.nextDouble();
        if(sal<=0){
            System.out.println("工资无效");
            return;
        }
        if(2000<=sal  && sal<2500){
            sal=sal-2000;
            System.out.println(500*0.05);

        }else if( 2500<=sal  && sal<4000){
            sal=sal-2000;
            System.out.println(500*0.05 + (sal-500)*0.1);

        }else if(4000<=sal  && sal<6000){//sal是5900的话，计算公式就是: sal=5900-2000
            sal=sal-2000; //                500*0.05 + 1500*0.1 +1900*0.15
            System.out.println(500*0.05 + (2000-500)*0.1+(sal-2000)*0.15);
        }else  if(7000<=sal  && sal<22000){
            sal=sal-2000;
            System.out.println(500*0.05 + (2000-500)*0.1+(5000-2000)*0.15+(sal-20000)*0.2);
        }else  if(22000<=sal  && sal<42000){
            sal=sal-2000;
            System.out.println(500*0.05 + (2000-500)*0.1+(5000-2000)*0.15+(20000-5000)*0.2+(sal-20000)*0.25);
        }
    }
}



